﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;
namespace SQT.tracnghiem
{
    public partial class PartOfLesson : System.Web.UI.Page
    {
        public int lesson;
        public string title;
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                lesson = int.Parse(RouteData.Values["id"].ToString());

                var check_active = new TblLessonController().FetchAll().Where(x => x.LessonId == lesson).Single();
                title = check_active.LessonTitle;
                if (check_active.LessonActive == false)
                    Response.Redirect("~/trang-chu");
            }
            catch
            {
                Response.Redirect("~/trang-chu");
            }
        }
    }
}